<template>
	<view>
		<!-- <free-nav-bar title="扫码结果" showBack></free-nav-bar> -->
		<view class="pl-4 pr-4 pt-3 lisk lineHight-2-3">
			<view class="bg-F9C2BE text-BD3124 pl-2 pr-1 rounded" v-if="newlist.blacklistState === true">
				<i class="iconfont icon-hao pr-1"></i>
				该品牌企业已被加入黑名单！
			</view>
			<view>品牌码名称：{{ newlist.publicBrandName }}</view>
			<view>企业名称：{{ newlist.enterpriseName }}</view>
			<view>手机号：{{ newlist.phone }}</view>
			<view>统一社会信用代码：{{ newlist.unifiedCreditCode }}</view>
			<view>产品名称：{{ newlist.productName }}</view>
			<view>准入证书：
				<view class="position-relative" style="top: -20px; left: 80px; width: 180px; height: 220px">
					<u-image  style="width: 100%; height: 100%" :src="getFullImageUrl(newlist.admissionCertificateUrl)"
						@error="handleImageError"></u-image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import freeNavBar from "@/components/free-ui/free-nav-bar.vue";
	import $H from '@/common/free-lib/request.js';
	import {
		getImageUrl
	} from '@/common/free-lib/util.js';
	export default {
		components: {
			freeNavBar,
		},
		data() {
			return {
				newlist: {},
			};
		},
		onLoad(options) {
			const id = options.id;
			this.NewListDetail(id)
		},
		methods: {
			handleImageError() {
				uni.showToast({
					title: '图片格式不支持jpeg，请重新上传',
					icon: 'none',
					duration: 4000
				});
			
			},
			getFullImageUrl(imagePath) {
				return getImageUrl(imagePath);
			},
			NewListDetail(id) {
				$H.get('/agriculture/brandCode/visitor/scanCode', {
					id: id
				}, {
					token: false,
					header: {
						'Content-Type': 'application/x-www-form-urlencoded'
					}
				}).then(res => {
					this.newlist = res.result
				}).catch(error => {
					uni.showToast({
						title: "网络错误，请稍后再试",
						icon: 'none'
					});
				});
			},
		},
	};
</script>

<style lang="scss">
</style>